import { Provide } from '@midwayjs/core';
import { BaseService } from '@cool-midway/core';
import { InjectEntityModel } from '@midwayjs/typeorm';
import { Repository } from 'typeorm';
import { ContentTileEntity } from '../entity/tile';

@Provide()
export class ContentTileService extends BaseService {
    @InjectEntityModel(ContentTileEntity)
    contentTileEntity: Repository<ContentTileEntity>;

    /**
     * 获取公开的瓷片区列表
     */
    async listOpen() {
        return this.contentTileEntity.find({
            where: { status: 1 },
            order: { sort: 'ASC' },
        });
    }
}

